<!DOCTYPE html>
<html lang="en" >
<head>
    <meta charset="UTF-8">
    <title>后台用户管理界面</title>
    <link rel="stylesheet" href="./src/css/layui.css">
</head>
<body>
<div class="demoTable">
  搜索商品名字：
  <div class="layui-inline">
    <input class="layui-input" name="id" id="demoReload" autocomplete="off">
  </div>
  <button class="layui-btn" data-type="reload">搜索</button>
  <div class="layui-inline">
                  <input type="text" id="createTimeStart" class="layui-input userName"
                         name="createTimeStart" placeholder="操作时间(开始)" value="">
              </div>
              <div class="layui-inline">
                  <input type="text" id="createTimeEnd" class="layui-input userName"
                         name="createTimeEnd" placeholder="操作时间(结束)" value="">
              </div>
              <a class="layui-btn search_btn" lay-submit="" data-type="search" lay-filter="search">查询</a>
</div>
<table id="auction_info" lay-filter="test"></table>


<script src="./src/layui.js"></script>

<script>
    layui.use(['table','form','jquery','layer','laypage','laytpl','laydate'],function () {
        var table=layui.table,
            $=layui.jquery,
            laypage=layui.laypage,
            layer=layui.layer,
            laytpl=layui.laytpl,
			laydate=layui.laydate;
        table.render({
            id:"adminList",
            elem:'#auction_info',
            cellMinWidth: 80,
            url:'./拍卖模块数据.json',
            page:true,
            limit:10,
            limits:[10,20,30],
            //开启工具栏
            toolbar:true,
            cols:[
                [
                    {type:'checkbox'},//开启复选框
                    {title:'拍卖商品序号',field:'id',sort:'true'},
					{title:'拍卖商品名',field:'id'},
                    {title:'参与人数',field:'fullname',sort:'true'},
                    {title:'竞拍人数',field:'email',sort:'true'},
                    {title:'是否流拍',field:'sex',templet:'#sexTml'},
                    {title:'最终竞拍者',field:'birthday'},
                    {title:'最终成交价',field:'address',sort:'true'},
                    {title:'竞拍轮数',field:'phone',sort:'true'},
					{title:'拍卖开始时间',field:'id',sort:'true'},
                    {title:'拍卖结束时间',field:'roleName'}
                ]
            ],
            //处理从服务器端传过来的数据
            parseData:function (result) {
                return {
                    code: result.code == 200 ? 0 : result.code(),
                    msg: result.message,
                    data: result.data.list,
                    count: result.data.total
                }
            }
        });
       
		//日期选择模块js
		var start = laydate.render({
		                elem:'#createTimeStart',
		                max:'new Date()',
		                type:'date',
		                trigger:'click',
		                done:function (value,date) {
		                    end.config.min = date;
		                    end.config.min.month=date.month-1;
		                }
		            })
		
		            var end = laydate.render({
		                elem:'#createTimeEnd',
		                max:'new Date()',
		                type:'date',
		                trigger:'click',
		                done:function (value,date) {
		                    start.config.max = date;
		                    start.config.max.month = date.month-1;
		                }
		            })
			//日期搜索模块js '这里为table的js里的id'
			$(".search_btn").click(function () {
			            table.reload('logList',{
			                page:1,
			                where:{
			                    operate:$("#operation").val(),
			                    begin:$("#createTimeStart").val(),
			                    end:$("#createTimeEnd").val()
			                },
			                parseData:function (result) {
			                    return {
			                        count:result.data.total,
			                        msg:result.message,
			                        data:result.data.list,
			                        code:result.code==200?0:result.code
			                    }
			                }
			            })
			
			        });
    })
	
</script>
<script type="text/html" id="sexTml" >
    {{# if(d.sex==1){ }}
    <span>否</span>
    {{# }else{ }}
    <span>是</span>
    {{# } }}
</script>

</body>

</html>